class A {
  type: boolean

  changeType(): void {
    this.type = !this.type
  }
}

class B {
  name: string

  getName(): string {
    return this.name
  }
}

class C implements A, B {
  type: boolean = false
  name: string = 'xiaomin'
  changeType: () => void
  getName: () => string
}

function mixin(curCls: any, itemCls: any[]) {
  itemCls.forEach(item => {
    Object.getOwnPropertyNames(item.prototype).forEach(name => {
      curCls.prototype[name] = item.prototype[name]
    })
  })
}

mixin(C, [A, B])

let ccc = new C()
console.log(ccc.type);
ccc.changeType()
console.log(ccc.type);